import pytest


@pytest.fixture()
def fun():
    print("---前置")
    raise Exception("自定义异常")
    yield
    print("---后置")


def test_a(fun):
    print("--------------test_a")